package com.ziq.zcamp.bean.post

import com.blankj.utilcode.util.GsonUtils
import com.ziq.zcamp.proguard.ProguardKeep
import java.io.Serializable

open class PostingDetail : ProguardKeep, Serializable {
    var post : Post? = null
    var user : User? = null
    var camp_info : CampInfo? = null
    var view_count :Int = 0

    override fun equals(other: Any?): Boolean {
        if(other is PostingDetail && other.post?.post_id != null){
            return other.post?.post_id == this.post?.post_id
        }
        return super.equals(other)
    }

    override fun hashCode(): Int {
        var result = super.hashCode()
        if(post?.post_id?.isNotEmpty() == true){
            result = post?.post_id!!.hashCode()
        }
        return result
    }

    fun parseData(){
        camp_info?.parseData()
        post?.parseData()
        user?.parseData()
    }

}